﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:WPF="clr-namespace:Gma.QrCodeNet.Encoding.Windows.WPF;assembly=Gma.QrCodeNet.Encoding" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="DeliveryRoomStatusBulletin.MainWindow"
        xmlns:local="clr-namespace:DeliveryRoomStatusBulletin"
        WindowState="Maximized"
        WindowStyle="None"
        WindowStartupLocation="CenterScreen"
        Title="MainWindow" Height="1080" Width="1920" Loaded="Window_Loaded">
    <Window.Resources>
        <LinearGradientBrush x:Key="Bule" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF28B1F9" Offset="0.3"/>
            <GradientStop Color="White"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="Green" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="White" Offset="0"/>
            <GradientStop Color="#FF87CC48" Offset="0.3"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="Red" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFF9634F" Offset="0.3"/>
            <GradientStop Color="White"/>
        </LinearGradientBrush>
        <ControlTemplate x:Key="ProcessStageTemplate" TargetType="{x:Type ProgressBar}">
            <ControlTemplate.Resources>
                <Style x:Key="{x:Type TextBlock}" TargetType="{x:Type TextBlock}">
                    <Setter Property="Foreground" Value="#c7c7c7"/>
                </Style>
            </ControlTemplate.Resources>
            <Grid SnapsToDevicePixels="True">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition />
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition/>

                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Path x:Name="path1" Grid.Column="0" Grid.Row="0" Data="M-4,130.50294 L-4,76.520004 143.47469,76.520004 175.00074,102.80409 143.47531,130.30635 z"  Height="69.75" Margin="0,0,-2.333,0.25" Stretch="Fill" VerticalAlignment="Center" Grid.ColumnSpan="2" HorizontalAlignment="Center" Width="179"  />
                <Path x:Name="path2" Grid.Column="1" Data="M140.47585,132.52 L158.06308,152.936 140.47618,172.92 235.29373,172.92 252.56349,153.336 235.29435,132.52 z"  Height="Auto" Margin="8.499,-0.25,-1.668,0.25" Stretch="Fill" VerticalAlignment="Center" HorizontalAlignment="Center" Width="Auto" Grid.ColumnSpan="3" d:LayoutOverrides="GridBox"  />
                <Path x:Name="path3" Grid.Column="3" Data="M148.48111,132.52 L162.9763,152.936 148.48144,172.52 228.00201,172.52 228.00262,132.52 z"  Margin="9.501,0,0,0" Stretch="Fill" HorizontalAlignment="Stretch" Width="Auto" Grid.ColumnSpan="2"   />
                <TextBlock x:Name="tb_1" Text="{Binding STATEcaption1}"
                           Grid.Column="0"
                           Grid.Row="0"
                           TextAlignment="Center" FontSize="21.333" VerticalAlignment="Center" Foreground="White"/>
                <TextBlock  x:Name="tb_2" Text="{Binding STATEcaption2}"
                           Grid.Column="2"
                           Grid.Row="0"
                           TextAlignment="Center" VerticalAlignment="Center" FontSize="21.333" Foreground="White"/>
                <TextBlock  x:Name="tb_3" Text="{Binding STATEcaption3}"
                           Grid.Column="4"
                           Grid.Row="0"
                           TextAlignment="Center" FontSize="21.333" VerticalAlignment="Center" Foreground="White"/>

            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="local:ProcessStageHelper.ProcessStage"  Value="Stage1">
                    <Setter Property="Fill"
                            Value="{DynamicResource Bule}"
                            TargetName="path1"/>
                    <Setter Property="Stroke"
                            Value="#FFECECEC"
                            TargetName="path1"/>
                </Trigger>
                <Trigger Property="local:ProcessStageHelper.ProcessStage"  Value="Stage2">
                    <Setter Property="Fill"
                            Value="{DynamicResource Bule}"
                            TargetName="path1"/>
                    <Setter Property="Stroke"
                            Value="#FFECECEC"
                            TargetName="path1"/>
                    <Setter Property="Fill"
                            Value="{DynamicResource Green}"
                            TargetName="path2"/>
                    <Setter Property="Stroke"
                            Value="#FFECECEC"
                            TargetName="path2"/>
                </Trigger>
                <Trigger Property="local:ProcessStageHelper.ProcessStage"  Value="Stage3">
                    <Setter Property="Fill"
                            Value="{DynamicResource Bule}"
                            TargetName="path1"/>
                    <Setter Property="Stroke"
                            Value="#FFECECEC"
                            TargetName="path1"/>
                    <Setter Property="Fill"
                            Value="{DynamicResource Green}"
                            TargetName="path2"/>
                    <Setter Property="Stroke"
                            Value="#FFECECEC"
                            TargetName="path2"/>
                    <Setter Property="Fill"
                            Value="{DynamicResource Red}"
                            TargetName="path3"/>
                    <Setter Property="Stroke"
                            Value="#FFECECEC"
                            TargetName="path3"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <DataTemplate x:Key="DataTemplate1">
            <Border BorderBrush="#FF0475CB" BorderThickness="1" Margin="5" CornerRadius="15">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFE7F6FE" Offset="1"/>
                        <GradientStop Color="White"/>
                    </LinearGradientBrush>
                </Border.Background>
                <Border.Effect>
                    <DropShadowEffect Opacity="0.3" Color="Black" ShadowDepth="6" Direction="270"/>
                </Border.Effect>
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition Width="588" />
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Image Source="Image/肚子.png" Grid.Column="0" Grid.RowSpan="2" Margin="30,10,10,10" Width="40" Height="40" HorizontalAlignment="Left"/>
                    <DockPanel Grid.Column="1" Grid.RowSpan="2" Width="200">
                        <Label Content="{Binding Bedid}"  VerticalAlignment="Center" FontSize="36" Foreground="#FF999999" Margin="10" HorizontalAlignment="Left"/>
                    </DockPanel>

                    <Label Content="{Binding Name}" Width="160" Grid.Column="2" Grid.RowSpan="2" VerticalAlignment="Center" FontSize="36" Foreground="#FF999999" Margin="10" />
                    <DockPanel Grid.Row="0" Grid.Column="3" VerticalAlignment="Center"   HorizontalAlignment="Left" Margin="10,0,10,0" Height="40" >
                        <Ellipse  Grid.Column="0" Fill="#FFB6D651" HorizontalAlignment="Left" Stroke="Black" Width="20" Height="20"/>
                        <Label Content="家属配合内容：" Grid.Column="1" Foreground="#FF999999" FontSize="20"  />
                    </DockPanel>
                    <TextBlock Text="{Binding Goods}" Margin="10,0,10,0" Grid.Row="1" TextWrapping="Wrap" Grid.Column="3"  Foreground="#FF999999" FontSize="20"  HorizontalAlignment="Left" Height="80"/>
                    <TextBlock Text="请耐心等候" Grid.Column="4" Foreground="#FF999999" FontSize="32" Grid.RowSpan="2" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"  Margin="0,0,60,0"></TextBlock>
                    <ProgressBar Template="{StaticResource ProcessStageTemplate}" Width="500" Height="70" Grid.Column="5" Grid.RowSpan="2" Grid.Row="0" Value="{Binding Childbirthstate}" local:ProcessStageHelper.ProcessCompletion ="{Binding Value, RelativeSource={RelativeSource Self}}"  Maximum="3" Margin="50,10" />
                </Grid>
            </Border>
        </DataTemplate>
        <Style x:Key="LabelStyle" TargetType="{x:Type Label}">
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Padding" Value="5"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Label}">
                        <Border CornerRadius="20" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <SolidColorBrush x:Key="ListBorder" Color="#828790"/>
        <Style x:Key="ListBoxStyle" TargetType="{x:Type ListBox}">
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
            <Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
            <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
            <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListBox}">
                        <Border x:Name="Bd" CornerRadius="15" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="1" SnapsToDevicePixels="true">
                            <ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </ScrollViewer>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                            </Trigger>
                            <Trigger Property="IsGrouping" Value="true">
                                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Storyboard x:Key="ShowText" >
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="textBlock">
        		<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-46"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="42"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-2"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="textBlock">
        		<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
        	</DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="ShowContent">
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="grid1">
                <EasingDoubleKeyFrame KeyTime="0" Value="-1140"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-35"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="-15"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="ShowTag">
        	<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="grid">
        		<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
        	</ObjectAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="grid">
                <EasingDoubleKeyFrame KeyTime="0" Value="-1140"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-35"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="-15"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="grid1">
            	<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>

    </Window.Resources>
	<Window.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource ShowContent}"/>
		</EventTrigger>
	</Window.Triggers>
    <Grid Background="Transparent">
        <Grid x:Name="grid1" RenderTransformOrigin="0.5,0.5" Visibility="Visible">
        	<Grid.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform/>
        			<SkewTransform/>
        			<RotateTransform/>
        			<TranslateTransform/>
        		</TransformGroup>
        	</Grid.RenderTransform>
            <Grid Background="#FFF4F7FC" Margin="-8,0,8,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="112*"/>
                    <ColumnDefinition Width="112*"/>
                    <ColumnDefinition Width="112*"/>
                    <ColumnDefinition Width="112*"/>
                    <ColumnDefinition Width="112*"/>
                    <ColumnDefinition Width="112*"/>
                    <ColumnDefinition Width="112*"/>
                    <ColumnDefinition Width="150*"/>
                    <ColumnDefinition Width="468*"/>
                    <ColumnDefinition Width="482*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="100"/>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="1000*"/>
                    <RowDefinition Height="200*"/>
                    <RowDefinition Height="55"/>
                </Grid.RowDefinitions>
                <ListBox x:Name="listboxdata"    Grid.Row="2" ItemTemplate="{DynamicResource DataTemplate1}" BorderBrush="#FF0475CB" BorderThickness="1" Margin="15" Grid.ColumnSpan="10" Style="{DynamicResource ListBoxStyle}" Background="White">
                    <ListBox.Resources>
                        <Style TargetType="ListBoxItem">
                            <Style.Resources>
                                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/>
                            </Style.Resources>
                        </Style>
                    </ListBox.Resources>
                </ListBox>

                <StackPanel Grid.Column="0" Grid.Row="3" Margin="5,0,5,10" Grid.RowSpan="2" VerticalAlignment="Center">
                    <local:UserItem />
                </StackPanel>
                <StackPanel Grid.Column="1" Grid.Row="3" Margin="5,0,5,10" Grid.RowSpan="2" VerticalAlignment="Center">
                    <local:UserItem />
                </StackPanel>
                <StackPanel Grid.Column="2" Grid.Row="3" Margin="5,0,5,10" Grid.RowSpan="2" VerticalAlignment="Center">
                    <local:UserItem />
                </StackPanel>
                <StackPanel Grid.Column="3" Grid.Row="3" Margin="5,0,5,10" Grid.RowSpan="2" VerticalAlignment="Center">
                    <local:UserItem />
                </StackPanel>
                <StackPanel Grid.Column="4" Grid.Row="3" Margin="5,0,5,10" Grid.RowSpan="2" VerticalAlignment="Center">
                    <local:UserItem />
                </StackPanel>
                <StackPanel Grid.Column="5" Grid.Row="3" Margin="5,0,5,10" Grid.RowSpan="2" VerticalAlignment="Center">
                    <local:UserItem />
                </StackPanel>
                <StackPanel Grid.Column="6" Grid.Row="3" Margin="5,0,5,10" Grid.RowSpan="2" VerticalAlignment="Center">
                    <local:UserItem />
                </StackPanel>

                <StackPanel Grid.Column="7" Grid.Row="3" Margin="0" Grid.RowSpan="1" VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Center">
                    <Image Source="Image/肚子.png" Margin="5,10,10,10" Height="60" Width="60"/>
                    <TextBlock Text="待产孕妇" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="16"/>
                </StackPanel>

                <WPF:QrCodeGeoControl Name="qrcode" Grid.Column="9"  Grid.Row="3"  Text="Skynet" Width="100" Height="100" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,15,10" Visibility="Hidden"     />
                <Image Source="Image/twlogo.png" Grid.Column="9"  Grid.Row="4" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,15,10"/>


                <Border Background="#FF0475CB" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="10">
                    <StackPanel Orientation="Horizontal" >
                        <Image Source="Image/妇幼logo.png" Margin="20,5,5,5"/>
                        <StackPanel HorizontalAlignment="Left">
                            <TextBlock Text="Delivery Room Announcement" TextWrapping="Wrap"  Foreground="White" FontSize="36" FontFamily="Microsoft YaHei UI" FontWeight="Bold" VerticalAlignment="Center" Margin="5,10,0,0" />
                            <TextBlock x:Name="tbHosName" Text="省妇幼产房产妇状态公告栏" TextWrapping="Wrap"  Foreground="White" FontSize="20" FontFamily="Microsoft YaHei UI" FontWeight="Bold" VerticalAlignment="Bottom" Margin="5,5,0,0" HorizontalAlignment="Left" />
                        </StackPanel>
                    </StackPanel>

                </Border>

                <Border Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="10" >
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0,1" MappingMode="RelativeToBoundingBox" StartPoint="1,0">
                            <GradientStop Color="#FF0475CB" Offset="0.1"/>
                            <GradientStop Color="#FFF4F7FC" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                </Border>

                <StackPanel Grid.Column="9" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,20">
                    <TextBlock x:Name="tbDate" Foreground="White" FontSize="24" FontFamily="Microsoft YaHei UI" FontWeight="Bold" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,20,5"/>
                    <TextBlock x:Name="tbTime" Foreground="White" FontSize="48" FontFamily="Microsoft YaHei UI" FontWeight="Bold" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,20,0"/>
                </StackPanel>
                <Grid  x:Name="grid_lbCmis1" Grid.ColumnSpan="2" Grid.Column="8" Margin="0" Grid.Row="3">
                    <TextBlock   DataContextChanged="textBlock_DataContextChanged"  x:Name="textBlock" Margin="30,0,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Center" FontSize="21.333" RenderTransformOrigin="0.5,0.5">
                	<TextBlock.RenderTransform>
                		<TransformGroup>
                			<ScaleTransform/>
                			<SkewTransform/>
                			<RotateTransform/>
                			<TranslateTransform/>
                		</TransformGroup>
                	</TextBlock.RenderTransform>
                    <TextBlock.Effect>
                        <DropShadowEffect ShadowDepth="3"></DropShadowEffect>
                    </TextBlock.Effect>
                    </TextBlock>
                </Grid>
            </Grid>
        </Grid>
        <Grid x:Name="grid" Visibility="Visible">
        	<Grid.RowDefinitions>
        		<RowDefinition Height="3*"/>
        		<RowDefinition/>
        	</Grid.RowDefinitions>
        
            <Grid.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                </TransformGroup>
            </Grid.RenderTransform>

        <MediaElement Source="EasyUI入门视频教程05.avi" x:Name="media" LoadedBehavior="Play"  ></MediaElement>
        </Grid>
    </Grid>
    
</Window>
